<template>
  <div style="height: 100%">
    <div v-if="!login_a"  style="height: 100%">
        <i-login />
    </div> 
    <div v-else  style="height: 100%">
       <el-container>
        <el-aside width="210px">
          <div class="logo">
            <a href="">
              <img src="~/assets/logo.png" alt="JQOT管理平台" />
              <h1>JQOT管理平台</h1>
            </a>
          </div>
          <i-menu></i-menu>
        </el-aside>
        <el-container>
          <el-header height="50px">Header</el-header>
          <el-main>
            <nuxt />
          </el-main>
          <el-footer height="35px">Footer</el-footer>
        </el-container>
      </el-container> 
    </div>
  </div>

</template>
<script type="text/javascript">
import locale from 'element-ui/lib/locale/lang/zh-CN'
import menu from './menu.vue'
import login from '@/pages/login/login'
//通过命名空间的方式映入
import { createNamespacedHelpers } from 'vuex'
//获取需要管理的方法
const { mapState, mapActions, mapMutations } = createNamespacedHelpers('user')
export default {
  props: {
    value: [Array, Object]
  },
  components: {
    "i-menu": menu,
    "i-login":login
  },
  data() {
    return {
      login_a:true,
    }
  },
  /**
   * 计算属性
   * @type {Object}
   */
  computed: {
    ...mapState(['login'])
  },
  /**
   * 数据监听
   * @type {Object}
   */
  watch: {

  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  mounted() {

  },
  /**
   * 页面方法
   * @type {Object}
   */
  methods: {

  }
}

</script>
<style type="text/css" lang="scss">
html,
body,
#__nuxt,
#__layout,
.el-container {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
}

.logo {
  position: relative;
  width: 100%;
  height: 50px;
  line-height: 50px;
  background: #2b2f3a;
  text-align: center;
  overflow: hidden;

  img {

    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 12px;

  }

  a {
    display: inline-block;
    width: 100%;
    overflow: hidden;
  }

  h1 {
    display: inline-block;
    margin: 0;
    color: #fff;
    font-weight: 600;
    line-height: 50px;
    font-size: 14px;
    font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
    vertical-align: middle;
  }
}

.el-header {
  height: 50px;
  line-height: 50px;
  overflow: hidden;
  position: relative;
  background: #fff;
  -webkit-box-shadow: 1px 0 4px rgba(0, 21, 41, 0.08);
  box-shadow: 1px 0 4px rgba(0, 21, 41, 0.08);
}

.el-footer {
  text-align: center;
  background-color: #eee;
  line-height: 35px;
  -webkit-box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

.el-aside {
  background-color: #545c64;
}

.el-main {
  background-color: #f4f4f4;
}

</style>
